home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / lisp / kcl / akcl / akcl.lha / akcl / V / c / num_co.c < prev    next >
C/C++ Source or Header  |  1990-04-01  |  6KB  |  383 lines

  1. Changes file for /usr/local/src/kcl/c/num_co.c
  2. Created on Sun Apr  1 22:12:20 1990
  3. Usage \n@s[Original text\n@s|Replacement Text\n@s]
  4. See the file rascal.ics.utexas.edu:/usr2/ftp/merge.c
  5. for a program to merge change files.  Anything not between
  6. "\n@s[" and  "\n@s]" is a simply a comment.
  7. This file was constructed using emacs and  merge.el
  8. Enhancements Copyright (c) W. Schelter All rights reserved.
  9.    by (Bill Schelter)  wfs@carl.ma.utexas.edu 
  10.  
  11.  
  12. ****Change:(orig (19 19 a))
  13. @s[object plus_half, minus_half;
  14.  
  15.  
  16. @s|object plus_half, minus_half;
  17.  
  18. #ifdef CONVEX
  19. #define VAX
  20. #endif
  21.  
  22. @s]
  23.  
  24.  
  25. ****Change:(orig (92 93 c))
  26. @s[    h = *(int *)(&d);
  27.     l = *((int *)(&d) + 1);
  28.  
  29. @s|    h = *((int *)(&d) + HIND);
  30.     l = *((int *)(&d) + LIND);
  31.  
  32. @s]
  33.  
  34.  
  35. ****Change:(orig (219 219 c))
  36. @s[    return(((*(int *)(&d) & 0x7ff00000) >> 20) - 1022);
  37.  
  38. @s|    return((((*((int *)(&d) + HIND)) & 0x7ff00000) >> 20) - 1022);
  39.  
  40. @s]
  41.  
  42.  
  43. ****Change:(orig (239 239 c))
  44. @s[        return(0.0);
  45.     *(int *)(&d)
  46.  
  47. @s|        return(0.0);
  48.     *((int *)(&d) + HIND)
  49.  
  50. @s]
  51.  
  52.  
  53. ****Change:(orig (250 250 c))
  54. @s[    = *(int *)(&d) & 0x800fffff | ((e + 1022) << 20) & 0x7ff00000;
  55.  
  56. @s|    = *((int *)(&d) + HIND) & 0x800fffff | ((e + 1022) << 20) & 0x7ff00000;
  57.  
  58. @s]
  59.  
  60.  
  61. ****Change:(orig (341 341 a))
  62. @s[    vs_pop;
  63.     return(z);
  64. }
  65.  
  66.  
  67. @s|    vs_pop;
  68.     return(z);
  69. }
  70.  
  71. /* Coerce X to single-float if one arg,
  72.    otherwise coerce to same float type as second arg */
  73.  
  74. @s]
  75.  
  76.  
  77. ****Change:(orig (362 363 c))
  78. @s[        if (narg > 1 && t == t_longfloat)
  79.             x = make_longfloat((double)(fix(x)));
  80.  
  81. @s|        if (narg > 1 && t == t_shortfloat)
  82.           x = make_shortfloat((shortfloat)(fix(x)));
  83.  
  84. @s]
  85.  
  86.  
  87. ****Change:(orig (365 365 c))
  88. @s[            x = make_shortfloat((shortfloat)(fix(x)));
  89.  
  90. @s|          x = make_longfloat((double)(fix(x)));
  91.  
  92. @s]
  93.  
  94.  
  95. ****Change:(orig (371 372 c))
  96. @s[        if (narg > 1 && t == t_longfloat)
  97.             x = make_longfloat(d);
  98.  
  99. @s|        if (narg > 1 && t == t_shortfloat)
  100.           x = make_shortfloat((shortfloat)d);
  101.  
  102. @s]
  103.  
  104.  
  105. ****Change:(orig (374 374 c))
  106. @s[            x = make_shortfloat((shortfloat)d);
  107.  
  108. @s|          x = make_longfloat(d);        
  109.  
  110. @s]
  111.  
  112.  
  113. ****Change:(orig (378 379 c))
  114. @s[        if (narg > 1 && t == t_longfloat)
  115.             x = make_longfloat((double)(sf(x)));
  116.  
  117. @s|        if (narg > 1 && t == t_shortfloat);
  118.           else
  119.             x = make_longfloat((double)(sf(x)));
  120.  
  121. @s]
  122.  
  123.  
  124. ****Change:(orig (521 521 c))
  125. @s[        if (number_minusp(q1) && number_compare(q, q1)) {
  126.  
  127. @s|        if (number_minusp(q) && number_compare(q, q1)) {
  128.  
  129. @s]
  130.  
  131.  
  132. ****Change:(orig (642 642 c))
  133. @s[        if (number_plusp(q1) && number_compare(q, q1)) {
  134.  
  135. @s|        if (number_plusp(q) && number_compare(q, q1)) {
  136.  
  137. @s]
  138.  
  139.  
  140. ****Change:(orig (1021 1021 c))
  141. @s[        vs_base[0] = small_fixnum(6);
  142.  
  143. @s|        vs_base[0] = small_fixnum(24);
  144.  
  145. @s]
  146.  
  147.  
  148. ****Change:(orig (1023 1023 c))
  149. @s[        vs_base[0] = small_fixnum(14);
  150.  
  151. @s|        vs_base[0] = small_fixnum(53);
  152.  
  153. @s]
  154.  
  155.  
  156. ****Change:(orig (1037 1037 c))
  157. @s[            vs_base[0] = small_fixnum(6);
  158.  
  159. @s|            vs_base[0] = small_fixnum(24);
  160.  
  161. @s]
  162.  
  163.  
  164. ****Change:(orig (1043 1043 c))
  165. @s[            vs_base[0] = small_fixnum(14);
  166.  
  167. @s|            vs_base[0] = small_fixnum(53);
  168.  
  169. @s]
  170.  
  171.  
  172. ****Change:(orig (1049 1049 c))
  173. @s[            vs_base[0] = small_fixnum(13);
  174.  
  175. @s|            vs_base[0] = small_fixnum(53);
  176.  
  177. @s]
  178.  
  179.  
  180. ****Change:(orig (1055 1055 c))
  181. @s[            vs_base[0] = small_fixnum(14);
  182.  
  183. @s|            vs_base[0] = small_fixnum(53);
  184.  
  185. @s]
  186.  
  187.  
  188. ****Change:(orig (1141 1141 a))
  189. @s[        vs_base[0] = x->cmp.cmp_imag;
  190.         break;
  191.     }
  192. }
  193.  
  194.  
  195. @s|        vs_base[0] = x->cmp.cmp_imag;
  196.         break;
  197.     }
  198. }
  199.  
  200. static float sf1,sf2;
  201. static sf_eql()
  202. {return(sf1==sf2);}
  203.  
  204. static lf_eql(a,b)
  205.      double a,b;
  206. {return(a==b);}
  207. #define LF_EQL(a,b) lf_eql((double)(a),(double)(b))
  208. #define SF_EQL(a,b) (sf1=a,sf2=b,sf_eql())
  209.  
  210.  
  211. @s]
  212.  
  213.  
  214. ****Change:(orig (1157 1163 d))
  215. @s[#ifdef IBMRT
  216.  
  217.  
  218.  
  219.  
  220. #endif
  221.  
  222. @s,
  223.  
  224. @s|
  225. @s]
  226.  
  227.  
  228. ****Change:(orig (1172 1176 c))
  229. @s[    l[0] = 1;
  230.     smallest_float = *(float *)l;
  231.     l[0] = 0;
  232.     l[1] = 1;
  233.  
  234. @s,    smallest_double = *(double *)l;
  235.  
  236. @s|
  237.     ((int *) &smallest_float)[0]= 1;
  238.     ((int *) &smallest_double)[HIND] = 0;
  239.     ((int *) &smallest_double)[LIND] = 1;
  240.  
  241.  
  242. @s]
  243.  
  244.  
  245. ****Change:(orig (1216 1220 c))
  246. @s[    l[0] = 0x7f7fffff;
  247.     biggest_float = *(float *)l;
  248.     l[0] = 0x7fefffff;
  249.     l[1] = 0xffffffff;
  250.  
  251. @s,    biggest_double = *(double *)l;
  252.  
  253. @s|
  254.     ((int *) &biggest_float)[0]= 0x7f7fffff;
  255.     ((int *) &biggest_double)[HIND] = 0x7fefffff;
  256.     ((int *) &biggest_double)[LIND] = 0xffffffff;
  257.  
  258. #ifdef BAD_FPCHIP
  259.  /* &&&& I am adding junk values to get past debugging */
  260.         biggest_float = 1.0e37;
  261.         smallest_float = 1.0e-37;
  262.         biggest_double = 1.0e308;
  263.         smallest_double = 1.0e-308;
  264.         printf("\n Used fake values for float max and mins ");
  265.  
  266. @s]
  267.  
  268.  
  269. ****Change:(orig (1222 1222 a))
  270. @s[#endif
  271. #endif
  272.  
  273. @s|#endif
  274. #endif
  275. #endif
  276.  
  277. @s]
  278.  
  279.  
  280. ****Change:(orig (1277 1277 a))
  281. @s[    biggest_double = *(double *)l;
  282. #endif
  283.  
  284.  
  285. @s|    biggest_double = *(double *)l;
  286. #endif
  287.  
  288. /* We want the smallest number not satisfying something,
  289.    and so we go quickly down, and then back up.  We have
  290.    to use a function call for test, since in line code may keep
  291.    too much precision, while the usual lisp eql,is not
  292.    in line.
  293.    We use SMALL as a multiple to come back up by.
  294. */
  295.  
  296. #define SMALL 1.05    
  297.  
  298. @s]
  299.  
  300.  
  301. ****Change:(orig (1279 1279 c))
  302. @s[         (float)(1.0 + float_epsilon) != (float)1.0;
  303.  
  304. @s|         !SF_EQL((float)(1.0 + float_epsilon),(float)1.0);
  305.  
  306. @s]
  307.  
  308.  
  309. ****Change:(orig (1281 1281 a))
  310. @s[         float_epsilon /= 2.0)
  311.         ;
  312.  
  313. @s|         float_epsilon /= 2.0)
  314.         ;
  315.     while(SF_EQL((float)(1.0 + float_epsilon),(float)1.0))
  316.       float_epsilon=float_epsilon*SMALL;
  317.  
  318. @s]
  319.  
  320.  
  321. ****Change:(orig (1283 1283 c))
  322. @s[         (float)(1.0 - float_negative_epsilon) != (float)1.0;
  323.  
  324. @s|         !SF_EQL((float)(1.0 - float_negative_epsilon) ,(float)1.0);
  325.  
  326. @s]
  327.  
  328.  
  329. ****Change:(orig (1285 1285 a))
  330. @s[         float_negative_epsilon /= 2.0)
  331.         ;
  332.  
  333. @s|         float_negative_epsilon /= 2.0)
  334.         ;
  335.     while(SF_EQL((float)(1.0 - float_negative_epsilon) ,(float)1.0))
  336.       float_negative_epsilon=float_negative_epsilon*SMALL;
  337.  
  338. @s]
  339.  
  340.  
  341. ****Change:(orig (1287 1287 c))
  342. @s[         1.0 + double_epsilon != 1.0;
  343.  
  344. @s|         !(LF_EQL(1.0 + double_epsilon, 1.0));
  345.  
  346. @s]
  347.  
  348.  
  349. ****Change:(orig (1289 1289 a))
  350. @s[         double_epsilon /= 2.0)
  351.         ;
  352.  
  353. @s|         double_epsilon /= 2.0)
  354.         ;
  355.     while((LF_EQL(1.0 + double_epsilon, 1.0)))
  356.       double_epsilon=double_epsilon*SMALL;
  357.       ;
  358.  
  359. @s]
  360.  
  361.  
  362. ****Change:(orig (1291 1291 c))
  363. @s[         1.0 - double_negative_epsilon != 1.0;
  364.  
  365. @s|         !LF_EQL(1.0 - double_negative_epsilon , 1.0);
  366.  
  367. @s]
  368.  
  369.  
  370. ****Change:(orig (1293 1293 a))
  371. @s[         double_negative_epsilon /= 2.0)
  372.         ;
  373.  
  374. @s|         double_negative_epsilon /= 2.0)
  375.         ;
  376.     while(LF_EQL(1.0 - double_negative_epsilon , 1.0))
  377.       double_negative_epsilon=double_negative_epsilon*SMALL;
  378.       ;
  379.     
  380.  
  381. @s]
  382.  
  383.